<?xml version="1.0" encoding="UTF-8" ?>
<XMLDB PATH="blocks/courserequest/db" VERSION="20100624" COMMENT="XMLDB file for Moodle blocks/courserequest"
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
    xsi:noNamespaceSchemaLocation="../../../lib/xmldb/xmldb.xsd"
>
  <TABLES>
    <TABLE NAME="block_courserequest" COMMENT="Stores an indivudual request" NEXT="block_courserequest_fields">
      <FIELDS>
        <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="userid"/>
        <FIELD NAME="userid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="title"/>
        <FIELD NAME="title" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" PREVIOUS="userid" NEXT="firstname"/>
        <FIELD NAME="firstname" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" PREVIOUS="title" NEXT="lastname"/>
        <FIELD NAME="lastname" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" PREVIOUS="firstname" NEXT="email"/>
        <FIELD NAME="email" TYPE="char" LENGTH="255" NOTNULL="false" SEQUENCE="false" PREVIOUS="lastname" NEXT="courseid"/>
        <FIELD NAME="courseid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" COMMENT="ELIS course id" PREVIOUS="email" NEXT="requeststatus"/>
        <FIELD NAME="requeststatus" TYPE="char" LENGTH="40" NOTNULL="true" DEFAULT="pending" SEQUENCE="false" PREVIOUS="courseid" NEXT="classid"/>
        <FIELD NAME="classid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="requeststatus" NEXT="usecoursetemplate"/>
        <FIELD NAME="usecoursetemplate" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="classid" NEXT="timecreated"/>
        <FIELD NAME="timecreated" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="usecoursetemplate" NEXT="timemodified"/>
        <FIELD NAME="timemodified" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="timecreated" NEXT="modifiedby"/>
        <FIELD NAME="modifiedby" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="timemodified" NEXT="statusnote"/>
        <FIELD NAME="statusnote" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" PREVIOUS="modifiedby"/>
      </FIELDS>
      <KEYS>
        <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="userid"/>
        <KEY NAME="userid" TYPE="foreign" FIELDS="userid" REFTABLE="user" REFFIELDS="id" PREVIOUS="primary" NEXT="modifiedby"/>
        <KEY NAME="modifiedby" TYPE="foreign" FIELDS="modifiedby" REFTABLE="user" REFFIELDS="id" PREVIOUS="userid"/>
      </KEYS>
    </TABLE>
    <TABLE NAME="block_courserequest_fields" COMMENT="Associates custom fields with the course request form" PREVIOUS="block_courserequest" NEXT="block_courserequest_data">
      <FIELDS>
        <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="fieldid"/>
        <FIELD NAME="fieldid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="sortorder"/>
        <FIELD NAME="sortorder" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="fieldid" NEXT="contextlevel"/>
        <FIELD NAME="contextlevel" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="sortorder"/>
      </FIELDS>
      <KEYS>
        <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="fieldid"/>
        <KEY NAME="fieldid" TYPE="foreign" FIELDS="fieldid" REFTABLE="local_eliscore_field" REFFIELDS="id" PREVIOUS="primary"/>
      </KEYS>
    </TABLE>
    <TABLE NAME="block_courserequest_data" COMMENT="Keeps track of custom field values in individual course requests" PREVIOUS="block_courserequest_fields">
      <FIELDS>
        <FIELD NAME="id" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" SEQUENCE="true" NEXT="requestid"/>
        <FIELD NAME="requestid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="id" NEXT="fieldid"/>
        <FIELD NAME="fieldid" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="requestid" NEXT="data"/>
        <FIELD NAME="data" TYPE="text" LENGTH="small" NOTNULL="false" SEQUENCE="false" PREVIOUS="fieldid" NEXT="contextlevel"/>
        <FIELD NAME="contextlevel" TYPE="int" LENGTH="10" NOTNULL="true" UNSIGNED="true" DEFAULT="0" SEQUENCE="false" PREVIOUS="data" NEXT="multiple"/>
        <FIELD NAME="multiple" TYPE="int" LENGTH="1" NOTNULL="true" UNSIGNED="false" DEFAULT="0" SEQUENCE="false" PREVIOUS="contextlevel"/>
      </FIELDS>
      <KEYS>
        <KEY NAME="primary" TYPE="primary" FIELDS="id" NEXT="requestid"/>
        <KEY NAME="requestid" TYPE="foreign" FIELDS="requestid" REFTABLE="block_courserequest" REFFIELDS="id" PREVIOUS="primary" NEXT="fieldid"/>
        <KEY NAME="fieldid" TYPE="foreign" FIELDS="fieldid" REFTABLE="local_eliscore_field" REFFIELDS="id" PREVIOUS="requestid"/>
      </KEYS>
    </TABLE>
  </TABLES>
</XMLDB>
